$(function () {
    $("#submit").on("click", function () {
        $.ajax({
            url: '/VipServlet?action=regist',
            dataType: 'json',
            data:$("#myform").serialize(),
            type: 'POST',
            success: function (resp) {
                console.info(resp.msg);
                if (resp.code == 0) {
                    $("#msg").html(resp.msg);
                    location.href="/pages/login.html";
                }else if (resp.code == 1){
                    $("#msg").html(resp.msg);
                } else {
                    $("#msg").html(resp.msg);
                }
            },
            error: function (response) {
                console.log(response);
            }
        })
    })
})